/***
 * @Author:
 * @Date: 2023-03-20 19:27:47
 * @LastEditors: xxx
 * @LastEditTime: 2023-03-30 00:31:58
 * @FilePath: \hart\hart\inc\hart_master.h
 * @Description: hart主机处理
 * @email:
 * @Copyright (c) 2023 by xxx, All Rights Reserved.
 */

#ifndef __HART_MASTER_H__
#define __HART_MASTER_H__
#include "lib.h"
#include "./hart_master_frame.h"
#pragma pack(1)
typedef struct
{
    uint8_t address_bit;       // 为1时表示基本主设备，为0时表示副主设备
    response_cb response_call; // 回复消息接口
    hart_response_t *response;
} hart_master_init_t;
#pragma pack()

extern BOOL hart_master_init(const hart_master_init_t *const init);
extern BOOL hart_master_handle(uint8_t *rxBuf, uint16_t len);
extern BOOL hart_master_command_req(const hart_command_req_t *const req); // 主机请求指令接口
#endif                                                                    // __HART_MASTER_H__
